<HTML><HEAD><TITLE>breal_bounds(+Number, -Min, -Max)</TITLE>
</HEAD><BODY>[ <A HREF="index.html">Arithmetic</A> | <A HREF="../../index.html">Reference Manual</A> | <A HREF="../../fullindex.html">Alphabetic Index</A> ]
<H1>breal_bounds(+Number, -Min, -Max)</H1>
Extracts lower and upper floating point bounds of Number
<DL>
<DT><EM>Number</EM></DT>
<DD>A number.
</DD>
<DT><EM>Min</EM></DT>
<DD>A variable or float.
</DD>
<DT><EM>Max</EM></DT>
<DD>A variable or float.
</DD>
</DL>
<H2>Description</H2>
    A bounded real is a real number represented by a lower and upper
    bound in floating point format. This predicate extracts both bounds
    and unifies them with Min and Max respectively. If Number is not a
    bounded real, the result returned is equivalent to converting it to
    a bounded real first.

<H3>Modes and Determinism</H3><UL>
<LI>breal_bounds(+, -, -) is det
</UL>
<H3>Exceptions</H3>
<DL>
<DT><EM>(4) instantiation fault </EM>
<DD>Number is not instantiated
<DT><EM>(24) number expected </EM>
<DD>Number is a not a number.
</DL>
<H2>Examples</H2>
<PRE>
Success:
    ?- breal_bounds(0.99__1.01, Min, Max).
    Min = 0.99
    Max = 1.01

    ?- breal(1.0, One), breal_bounds(One, Min, Max).
    One = 1.0__1.0
    Min = 1.0
    Max = 1.0

    ?- breal(1, One), breal_bounds(One, Min, Max).
    One = 1.0__1.0
    Min = 1.0
    Max = 1.0

    ?- breal_bounds(1, Min, Max).
    Min = 1.0
    Max = 1.0

    ?- breal_bounds(1.0, Min, Max).
    Min = 1.0
    Max = 1.0

    ?- breal_bounds(1_10, Min, Max).
    Min = 0.099999999999999992
    Max = 0.10000000000000002

Error:
    ?- breal_bounds("a", Min, Max).
    number expected in breal_bounds("a", Min, Max)

    ?- breal_bounds(2 + 4, Min, Max).
    number expected in breal_bounds(2 + 4, Min, Max)
</PRE>
<H2>See Also</H2>
<A HREF="../../kernel/typetest/breal-1.html">breal / 1</A>, <A HREF="../../kernel/arithmetic/breal-2.html">breal / 2</A>, <A HREF="../../kernel/arithmetic/breal_min-2.html">breal_min / 2</A>, <A HREF="../../kernel/arithmetic/breal_max-2.html">breal_max / 2</A>, <A HREF="../../kernel/arithmetic/breal_from_bounds-3.html">breal_from_bounds / 3</A>, <A HREF="../../kernel/arithmetic/is-2.html">is / 2</A>
</BODY></HTML>
